<%@ Page Language="VB" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="false" CodeFile="appUploadFormsReports.aspx.vb" Inherits="admin_appUploadFormsReports" title="Admin - Application Settings - Upload Reports & Forms" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc2" %>
<%@ Register Src="SubNavControls/AppSubNavControl.ascx" TagName="AppSubNavControl" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<uc1:AppSubNavControl ID="SubNavCtrl" runat="server" />
<asp:ObjectDataSource ID="FormsObjectDataSource" runat="server"
        DeleteMethod="RemoveInstance" InsertMethod="SaveInstance" SelectMethod="ListBySort"
        TypeName="Cdm.DataCore.CaseNotes.Forms" 
        DataObjectTypeName="Cdm.DataCore.CaseNotes.Forms"
        UpdateMethod="UpdateInstance" SortParameterName="sortExpr" >
    </asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="NewFormsObjectDataSource" runat="server" DataObjectTypeName="Cdm.DataCore.CaseNotes.Forms"
        InsertMethod="SaveInstance" TypeName="Cdm.DataCore.CaseNotes.Forms" SelectMethod="getNew">
    </asp:ObjectDataSource>


  <table cellpadding="0" cellspacing="0" width="900px">
       <tr><td width="20px" rowspan="6"></td>
       <td><h1><a id="pagecontent">Admin - Application Settings - Upload Reports & Forms</a></h1>
       </td><td>
    <asp:Label ID="FormsReportsSelectLabel" runat="server" AssociatedControlID="FileTypeDropDownList" Text="Select Type:" CssClass="adminSelectLabel"></asp:Label>
    <asp:DropDownList ID="FileTypeDropDownList" runat="server" CssClass="adminSelectForm" AutoPostBack="false">
        <asp:ListItem Value="Forms">Form</asp:ListItem>
        <asp:ListItem Value="Reports">Report</asp:ListItem>
    </asp:DropDownList>
    <asp:Button ID="SubmitTypeButton" runat="server" Text="Go" />
    </td></tr>
    <tr><td colspan="2">
        <cc2:ValidationErrorSummary ID="ErrorSummary" runat="server" Message="" Visible="false" />    
    </td></tr>
   <tr><td colspan="2">
            <asp:Label id="UploadMsgLabel" runat="server" visible="false" text="Upload successful. To grant permissions for users to see this file visit 'Edit Role Configuration'." CssClass="adminLabel"></asp:Label>
   </td></tr></table>
   
   <table>
   <tr><td>
        <cc2:ScrollingGridView ID="FormsScrollingGridView" runat="server" CssClass="gridOffsetSmall" Width="930px"  IsFixedColumn="false" CellPadding="5" CellSpacing="0" AllowSorting="true" Caption="Select Reports and Forms to be available to users in the system." CaptionAlign="Top" ToolTip="220"
            AutoGenerateColumns="False" ShowFooter="False" DataSourceID="FormsObjectDataSource" BorderColor="#21334B" BorderStyle="Solid" GridLines="Vertical" Visible="True" EmptyDataText="There are no items of this type.  Select the Add button to Add them.">
        <HeaderStyle CssClass="adminHeaderStyle" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" />
            <Columns>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:CheckBox ID="SelectCheckBox" runat="server" ToolTip="Check to select for delete. Then click Delete button below."></asp:CheckBox>
                    </ItemTemplate>
                    <HeaderStyle Width="80px" />
                    <ItemStyle HorizontalAlign="Center" Width="74px" />
                </asp:TemplateField>
                <asp:BoundField DataField="FormShortName" HeaderText="Name" SortExpression="FormShortName" HeaderStyle-Width="140px" ItemStyle-Width="140px" />
                <asp:BoundField DataField="DateUploaded" HeaderText="Date Uploaded" SortExpression="DateUploaded" HeaderStyle-Width="170px" ItemStyle-Width="170px" />
                <asp:BoundField DataField="FormLongName" HeaderText="Description" SortExpression="FormLongName" HeaderStyle-Width="260px" ItemStyle-Width="260px" />   
                <asp:CommandField ShowEditButton="True" HeaderText="Action"  AccessibleHeaderText="Action" HeaderStyle-Width="110px" ItemStyle-Width="100px" />
            </Columns>
        <AlternatingRowStyle BackColor="#E8ECF4" /></cc2:ScrollingGridView>
        
   </td>
   </tr><tr id="DeleteFormTableRow" runat="server">
        <td>&nbsp;&nbsp;&nbsp;
   <asp:Button ID="DeleteMultiFormButton" CommandArgument="DeleteMulti" runat="server" Text="Delete" OnClientClick="javascript:return confirm('Are you sure you want to delete these forms?');" />
   </td>
   </tr><tr>
   <td>
        <cc2:ScrollingGridView ID="ReportsScrollingGridView" runat="server" CssClass="gridOffsetSmall" IsFixedColumn="true" CellPadding="5" AllowSorting="true" Caption="Select Reports and Forms to be available to users in the system."  CaptionAlign="Top"  ToolTip="220"
            AutoGenerateColumns="False" ShowFooter="False" DataSourceID="FormsObjectDataSource" BorderColor="#21334B" BorderStyle="Solid" GridLines="Vertical" Visible="False">
        <HeaderStyle CssClass="adminHeaderStyle" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" />
        <FooterStyle CssClass="adminHeaderStyle" />
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="SelectCheckBox" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                     <HeaderStyle Width="80px" />
                    <ItemStyle HorizontalAlign="Center" Width="74px" />
                </asp:TemplateField>
                <asp:BoundField DataField="ReportShortName" HeaderText="Name" SortExpression="ReportShortName" HeaderStyle-Width="150px" ItemStyle-Width="150px" />
                <asp:BoundField DataField="DateUploaded" HeaderText="Date Uploaded" SortExpression="DateUploaded" HeaderStyle-Width="150px" ItemStyle-Width="150px"  />
                <asp:BoundField DataField="ReportLongName" HeaderText="Description" SortExpression="ReportLongName" HeaderStyle-Width="300px" ItemStyle-Width="300px" />
                <asp:CommandField ShowEditButton="True" HeaderText="Action"  AccessibleHeaderText="Action" HeaderStyle-Width="110px" ItemStyle-Width="80px" />
            </Columns>
        <AlternatingRowStyle BackColor="#E8ECF4" /></cc2:ScrollingGridView>
        </td></tr><tr Id="DeleteReportTableRow" runat="server">
        <td>
        &nbsp;&nbsp;&nbsp;<asp:Button ID="DeleteMultiReportButton" CommandArgument="DeleteMulti" runat="server" Text="Delete" OnClientClick="javascript:return confirm('Are you sure you want to delete these reports?');" Visible="False" />
       
       </td></tr>
       </table>
       
       <asp:panel id="NewRecordPanel" runat="server" visible="false" cssclass="gridOffset">
            <table border="0" cellpadding="2" cellspacing="0" width="800px">
                <tr>
                    <td style="width:60px">
                        <asp:Label ID="ShortNameLabel" runat="server" AssociatedControlID="shortName" Text="Name:" CssClass="adminLabel"></asp:Label>
                    </td>
                    <td style="width:300px">
                        <asp:TextBox ID="shortName" runat="server" CssClass="adminForm"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="width:60px">
                        <asp:Label ID="DescriptionLabel" runat="server" AssociatedControlID="description" Text="Description:" CssClass="adminLabel"></asp:Label>
                    </td>
                    <td style="width:300px">                        
                        <asp:TextBox ID="description" runat="server" CssClass="adminForm"></asp:TextBox><br />
                    </td>
                </tr>
                <tr>
                    <td style="width:60px">
                        <asp:Label ID="FileUploadLabel" runat="server" AssociatedControlID="FileUpload1" Text="Upload:" CssClass="adminLabel"></asp:Label>
                    </td>
                    <td style="width:300px">
                        <asp:FileUpload ID="FileUpload1" runat="server" CssClass="adminForm" width="500px" />
                    </td>
                </tr>
            </table>       
           <asp:Label ID="FileExistsLabel" runat="server" Visible="false" style="color:Red; font-family:verdana; font-size:8pt;">This file already exists.</asp:Label>
       </asp:panel>
</asp:Content>
    
<asp:Content ID="FixedPanel" runat="server" ContentPlaceHolderID="ContentPlaceHolderFixedAdmin">
<asp:Button ID="AddButton" runat="server" Text="Add" />
    <asp:Button ID="SaveButton" runat="server" Text="Save" Visible="false" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" Visible="false" />
</asp:Content>

